<!DOCTYPE html>
<html lang="zh-cn">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no"/>
    <meta name="renderer" content="webkit">
    <title></title>
    <link rel="stylesheet" href="./css/pintuer.css">
    <link rel="stylesheet" href="./css/admin.css">
    <script src="./js/jquery.js"></script>
    <script src="./js/pintuer.js"></script>
    <script src="./js/vuejs-2.5.16.js"></script>
    <script src="./js/axios-0.18.0.js"></script>
    <!-- 引入样式 -->
    <link rel="stylesheet" href="./element-ui/lib/theme-chalk/index.css">
    <!-- 引入组件库 -->
    <script src="./element-ui/lib/index.js"></script>


</head>
<body>
<div class="panel admin-panel" id="moviesListDiv">
    <div class="panel-head"><strong class="icon-reorder"> 用户列表</strong> <a href=""
                                                                           style="float:right; display:none;">添加字段</a>
    </div>

    <table class="table table-hover text-center">
        <tr>
            <th>用户ID</th>
            <th width="10%">用户昵称</th>
            <th width="5%">头像</th>
            <th>性别</th>
            <th>居住地</th>
            <th width="10%">状态</th>
            <th width="310">最近活跃地址</th>
        </tr>

        <tr v-for="managerInfoVo in this.pagination.list">

            <td v-text="managerInfoVo.id"></td>
            <td v-text="managerInfoVo.nickName"></td>
            <td width="20%"><img :src="managerInfoVo.avatar" alt="" width="70" height="50"/></td>
            <td v-text="managerInfoVo.gender"></td>
            <td v-text="managerInfoVo.city"></td>
            <td>
                {{managerInfoVo.created}}
            </td>
<!--            &lt;!&ndash;                    对于账户问题，用if判断了&ndash;&gt;-->
<!--            <td v-if="managerInfoVo.status==1"><i class="el-icon-circle-check">正常</i></td>-->
<!--            <td v-else-if="managerInfoVo.status!=1"><i class="el-icon-circle-close">冻结</i></td>-->

            <!--                    <td><i class="el-icon-location-information">查看</i></td>-->
            <td><a :href="'baidumap.html?userId='+managerInfoVo.id" ><i class="el-icon-view">查看</i></a></td>


        </tr>


        <tr>
            <td colspan="7" style="text-align:left;padding-left:20px;">
                <span>总记录数:{{pagination.total}}</span>
            </td>
        </tr>
        <tr>
            <td colspan="8">
                <div class="pagelist">
                    <!--分页组件-->
                    <el-pagination
                            @size-change="handleSizeChange"
                            @current-change="handleCurrentChange"
                            :current-page="pagination.page"
                            :page-size="pagination.pageSize"
                            :total="pagination.counts"
                            background
                            layout="prev, pager, next">
                    </el-pagination>
                </div>
            </td>
        </tr>
    </table>
</div>
<script type="text/javascript">
    // import pagination from "./element-ui/packages/pagination/src/pagination";

    const app = new Vue({
        el: '#moviesListDiv',
        data: {
            ids: [],
            cid: '', //分类id
            keyword: '', //关键字
            //status:0, //账户状态 1为正常，0为冻结
            pagination: { // 分页对象
                page: 1,
                pageSize: 15,
                counts: 20,
                list: []
            },
        },
        methods: {
            // 分页查询
            findByPage() {
                axios.get("/findAllUser", {
                    params: {
                        pageNum: this.pagination.page,
                        pageSize: this.pagination.pageSize,
                    }
                }).then(resp => {
                    console.log(resp.data);
                    // alert(resp.data);
                    this.pagination.list = resp.data.items;
                    this.pagination.total = resp.data.counts;
                });

            },
            //当前页改变时调用的方法
            handleCurrentChange(pageNum) {
                //将最新页码赋值给分页对象的当前页码
                this.pagination.pageNum = pageNum;
                //重新发起分页请求
                this.findByPage();
            },
            //改变每页大小时调用的方法
            handleSizeChange(pageSize) {
                //将最新的每页大爱小赋值给分页对象的当前页码
                this.pagination.pageSize = pageSize;
                //重新发起分页请求
                this.findByPage();
            },
        },
        created(){
            this.findByPage();
        }
    })
</script>
<script src="./js/verify.js"></script>
</body>
</html>
